﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RandomGenerator
{
    public partial class HtmlServerControls : System.Web.UI.Page
    {
        Random rand;
        public HtmlServerControls()
        {
            rand = new Random();
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void htmlSubmit_Click(object sender, EventArgs e)
        {
            int rangeBegin;
            int rangeEnd;
            int.TryParse(this.rangeBeginHtml.Value, out rangeBegin);
            int.TryParse(this.rangeEndHtml.Value, out rangeEnd);

            int randNumber = this.rand.Next(rangeBegin, rangeEnd);
            this.htmlResulPanel.InnerText = randNumber.ToString();
        }
    }
}